<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Set Values</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="../css/bootstrap.css" rel="stylesheet">
    <link href="../css/bootstrap-responsive.css" rel="stylesheet">
     <link href="../css/docs.css" rel="stylesheet">
<link href="../css/google-code-prettify/prettify.css" rel="stylesheet">
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    
    
    
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
	  
	  
	
    </style>
   

    
   
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
        <a class="brand" href="#">DairyVIP Project</a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              Logged in as <a href="#" class="navbar-link">Username</a>
            </p>
            <ul class="nav">
              <li><a href="index.jsp">Home</a></li>
              <li><a href="contro.jsp">Contributors</a></li>
              <li><a href="acknowledgements.jsp">Acknowledgements</a></li>
              <li class="active"><a href="#">My DairyVIP</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    
    
    
   
  <div class="container-fluid">
    
    <!-- Docs nav
    ================================================== -->
   
      
<!--<ul class="nav nav-list bs-docs-sidenav">
          <li><a href="woods"><i class="icon-chevron-right"></i> Wood's curves</a></li>
          <li><a href="#fit"><i class="icon-chevron-right"></i> Fit curves</a></li>
          <li><a href="#florida"><i class="icon-chevron-right"></i> Florida curves</a></li>
          <li><a href="#diphasic"><i class="icon-chevron-right"></i> Diphasic curves</a></li>
           </ul>-->
           
           <div class="row-fluid">
           
            <div class="span3">
 <p>General </p> 
 <p>Units: <select id="units">
  <option value="kg">KG</option>
  <option value="lbs">LBS</option></select></p> 
  
           
  <form>
    <table >
   
 <tr ><td >+/- (abs)</td><td > <input type="text" class="span4" value="0" name="mabs" id="mabs"></td>
   
<tr><td>+/- (%)</td><td>  <div class="input-append">
<input class="span3" id="pct" size="4" type="text" value="0" name="pct"><span class="add-on">%</span>
</div></td></tr>

<tr><td>Seasonality</td><td>  <div class="input-append">
<input class="span3" id="mseasonality" size="4" type="text" value="0" name="mseasonality"><span class="add-on">%</span>
</div></td></tr>
<tr><td>Jan</td><td>  <div class="input-append">
<input class="span3" id="msea1" size="4" type="text" value="100" name="msea1"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Feb</td><td>  <div class="input-append">
<input class="span3" id="msea2" size="4" type="text" value="100" name="msea2"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Mar</td><td>  <div class="input-append">
<input class="span3" id="msea3" size="4" type="text" value="100" name="msea3"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Apr</td><td>  <div class="input-append">
<input class="span3" id="msea4" size="4" type="text" value="100" name="msea4"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>May</td><td>  <div class="input-append">
<input class="span3" id="msea5" size="4" type="text" value="100" name="msea5"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Jun</td><td>  <div class="input-append">
<input class="span3" id="msea6" size="4" type="text" value="100" name="msea6"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Jul</td><td>  <div class="input-append">
<input class="span3" id="msea7" size="4" type="text" value="100" name="msea7"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Aug</td><td>  <div class="input-append">
<input class="span3" id="msea8" size="4" type="text" value="100" name="msea8"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Sep</td><td>  <div class="input-append">
<input class="span3" id="msea9" size="4" type="text" value="100" name="msea9"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Oct</td><td>  <div class="input-append">
<input class="span3" id="msea10" size="4" type="text" value="100" name="msea10"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Nov</td><td>  <div class="input-append">
<input class="span3" id="msea11" size="4" type="text" value="100" name="msea11"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Dec</td><td>  <div class="input-append">
<input class="span3" id="msea12" size="4" type="text" value="100" name="msea12"><span class="add-on">%</span>
</div></td></tr>
<tr>
  <td>Avg</td><td>  <div class="input-append">
<input class="span3" id="mseaavg" size="4" type="text" value="100" name="mseaavg"><span class="add-on">%</span>
</div></td></tr>
</table>
</form>


 
<!--<section id="woods">-->
          
          <h5> <a href="#" id="example1"  rel="popover" data-content="Wood's incomplete gamma function.
Source:
P.D.P. Wood
Algebraic model of the lactation curve in cattle
Nature 216 (1969): 164-165">Wood's curves</a></h5>
<form>
<table class="table ">
   
 <tr ><td >lact 1, a</td><td > <input type="text" class="span4" value="10.000" name="wood1a" id="wooda1"></td></tr>
  <tr ><td >lact 1, b</td><td > <input type="text" class="span4" value="0.3400" name="wood1b" id="woodb1"></td></tr>
   <tr ><td >lact 1, c</td><td > <input type="text" class="span4" value="0.0028" name="wood1c" id="woodc1"></td></tr>
    <tr ><td >lact 2, a</td><td > <input type="text" class="span4" value="19.300" name="wood2a" id="wooda2"></td></tr>
     <tr ><td >lact 2, b</td><td > <input type="text" class="span4" value="0.2550" name="wood2b" id="woodb2"></td></tr>
 
      <tr ><td >lact 2, c</td><td > <input type="text" class="span4" value="0.0034" name="wood2c" id="woodc2"></td></tr>
       <tr ><td >lact 3, a</td><td > <input type="text" class="span4" value="21.000" name="wood3a" id="wooda3"></td></tr>
        <tr ><td >lact 3, b</td><td > <input type="text" class="span4" value="0.2500" name="wood3b" id="woodb3"></td></tr>
  <tr ><td >lact 3, c</td><td > <input type="text" class="span4" value="0.0035" name="wood3c" id="woodc3"></td></tr>
 
 
 </table>          
<input class="btn" type="button" onclick="displayResults(); " value="Go" />
    </form>  


<script type="text/javascript">

function createTable()

{

var tableId = document.getElementById('myTable');

tableId.style.display = 'block';

}


function displayResults()
{
	
	createTable();
	//define general units in misc table
var units=document.getElementById('units').value;
var lbs;
if (units='kg') lbs=1;
else lbs=2.20462262;

//get msea1 to msea12
var i,j,x;
var msea=new Array();
for (i=1;i<13;i++)
{
	msea[i]=(document.getElementById('msea'+i).value)*0.01;
}

//compute day when mim from 1 to 24
var day=new Array();
for (j=1;j<25;j++)
{
  x=(j-1)*30.4+15.2;
  day[j]=document.getElementById("day"+j);
  day[j].innerHTML=Math.round(x);
  day[j].value=x;
}

var mseasonality=(document.getElementById('mseasonality').value)*0.01;
var mseaavg=(document.getElementById('mseaavg').value)*0.01;
var pct=(document.getElementById('pct').value)*0.01;
var mabs=(document.getElementById('mabs').value)*0.01;

var wooda=new Array();var woodb=new Array();var woodc=new Array(); var val=new Array(); var temp=new Array();

for (i=1;i<4;i++)
{
	wooda[i]=document.getElementById('wooda'+i).value;
	woodb[i]=document.getElementById('woodb'+i).value;
	woodc[i]=document.getElementById('woodc'+i).value;
}


for (j=1;j<25;j++){
	
for (i=1;i<13;i++)
{
	
/*val[i]=((mseasonality*(wooda[1]*(Math.pow((day[1].value),woodb[1]))*Math.exp(-woodc[1]*(day[1].value))*msea[1])+(1-mseasonality)*(wooda[1]*(Math.pow((day[1].value),woodb[1]))*Math.exp(-woodc[1]*(day[1].value))*mseaavg)))*(1+pct)*lbs+mabs;

temp[i]=document.getElementById("val1"+i);

temp[i].innerHTML=Math.round(val[i]*100)/100;*/
val[i]=((mseasonality*(wooda[1]*(Math.pow((day[j].value),woodb[1]))*Math.exp(-woodc[1]*(day[j].value))*msea[1])+(1-mseasonality)*(wooda[1]*(Math.pow((day[j].value),woodb[1]))*Math.exp(-woodc[1]*(day[j].value))*mseaavg)))*(1+pct)*lbs+mabs;

temp[i]=document.getElementById("val"+j+i);

temp[i].innerHTML=Math.round(val[i]*100)/100;

}


}

}
</script>
           <!--</section>-->
</div>  
        
<!--    <section id="fit">
       
          <h5> <a href="#" id="example2"  rel="popover" data-content="Enter peak milk, dim at peak milk, and 305-d total yield.  DairyVIP will attempt to fit a Wood's curve with these parameters">Fit curves</a></h5>
         
          test
           </section>
           
            <section id="florida">
        
          <h5> <a href="#" id="example3"  rel="popover" data-content="Curves fit on DHIA data for Florida and Georgia.">Florida curves</a></h5>
        
          test
           </section>
           
            <section id="diphasic">
       
          <h5> <a href="#" id="example4"  rel="popover" data-content="Diphasic lactation curves">Diphasic curves</a></h5>
         
          test
           </section>   -->   
     
      <div class="span4">


        <!-- computing results
        ================================================== -->
       
           <table  id="myTable" class="table table-striped" >
    <thead><tr><th>Month</th><th>Day</th><th>Jan</th>
    <th>Feb</th>
    <th>Mar</th>
    <th>Apr</th>
    <th>May</th>
    <th>Jun</th>
    <th>Jul</th>
    <th>Aug</th>
    <th>Sep</th>
    <th>Oct</th>
    <th>Nov</th>
    <th>Dec</th></tr></thead>
    <tbody><tr><td>1</td><td id="day1"></td><td id="val11"></td><td id="val12"></td><td id="val13"></td><td id="val14"></td><td id="val15"></td><td id="val16"></td><td id="val17"></td><td id="val18"></td><td id="val19"></td><td id="val110"></td><td id="val111"></td><td id="val112"></td></tr>
    <tr>
      <td>2</td><td id="day2"></td><td id="val21"></td><td id="val22"></td><td id="val23"></td><td id="val24"></td><td id="val25"></td><td id="val26"></td><td id="val27"></td><td id="val28"></td><td id="val29"></td><td id="val210"></td><td id="val211"></td><td id="val212"></td></tr>
    <tr>
      <td>3</td><td id="day3"></td><td id="val31"></td><td id="val32"></td><td id="val33"></td><td id="val34"></td><td id="val35"></td><td id="val36"></td><td id="val37"></td><td id="val38"></td><td id="val39"></td><td id="val310"></td><td id="val311"></td><td id="val312"></td></tr>
    <tr>
      <td>4</td><td id="day4"></td><td id="val41"></td><td id="val42"></td><td id="val43"></td><td id="val44"></td><td id="val45"></td><td id="val46"></td><td id="val47"></td><td id="val48"></td><td id="val49"></td><td id="val410"></td><td id="val411"></td><td id="val412"></td></tr>
    <tr>
      <td>5</td><td id="day5"></td><td id="val51"></td><td id="val52"></td><td id="val53"></td><td id="val54"></td><td id="val55"></td><td id="val56"></td><td id="val57"></td><td id="val58"></td><td id="val59"></td><td id="val510"></td><td id="val511"></td><td id="val512"></td></tr>
    <tr>
      <td>6</td><td id="day6"></td><td id="val61"></td><td id="val62"></td><td id="val63"></td><td id="val64"></td><td id="val65"></td><td id="val66"></td><td id="val67"></td><td id="val68"></td><td id="val69"></td><td id="val610"></td><td id="val611"></td><td id="val612"></td></tr>
    <tr>
      <td>7</td><td id="day7"></td><td id="val11"></td><td id="val12"></td><td id="val13"></td><td id="val14"></td><td id="val15"></td><td id="val16"></td><td id="val17"></td><td id="val18"></td><td id="val19"></td><td id="val110"></td><td id="val111"></td><td id="val112"></td></tr>
    <tr>
      <td>8</td><td id="day8"></td><td id="val11"></td><td id="val12"></td><td id="val13"></td><td id="val14"></td><td id="val15"></td><td id="val16"></td><td id="val17"></td><td id="val18"></td><td id="val19"></td><td id="val110"></td><td id="val111"></td><td id="val112"></td></tr>
    <tr>
      <td>9</td><td id="day9"></td><td id="val11"></td><td id="val12"></td><td id="val13"></td><td id="val14"></td><td id="val15"></td><td id="val16"></td><td id="val17"></td><td id="val18"></td><td id="val19"></td><td id="val110"></td><td id="val111"></td><td id="val112"></td></tr>
    <tr>
      <td>10</td><td id="day10"></td><td id="val11"></td><td id="val12"></td><td id="val13"></td><td id="val14"></td><td id="val15"></td><td id="val16"></td><td id="val17"></td><td id="val18"></td><td id="val19"></td><td id="val110"></td><td id="val111"></td><td id="val112"></td></tr>
    <tr>
      <td>11</td><td id="day11"></td></tr>
    <tr>
      <td>12</td><td id="day12"></td></tr>
    <tr>
      <td>13</td><td id="day13"></td></tr>
    <tr>
      <td>14</td><td id="day14"></td></tr>
    <tr>
      <td>15</td><td id="day15"></td></tr>
    <tr>
      <td>16</td><td id="day16"></td></tr>
    <tr>
      <td>17</td><td id="day17"></td></tr>
    <tr>
      <td>18</td><td id="day18"></td></tr>
    <tr>
      <td>19</td><td id="day19"></td></tr>
    <tr>
      <td>20</td><td id="day20"></td></tr>
    <tr>
      <td>21</td><td id="day21"></td></tr>
    <tr>
      <td>22</td><td id="day22"></td></tr>
    <tr>
      <td>23</td><td id="day23"></td></tr>
    <tr>
      <td>24</td><td id="day24"></td></tr>
    
    
    
    </tbody>
    </table>   
           
             </div>

 
</div>
  
    
      <footer class="footer">
       <%@ include file="../inc/footer.html" %>
      </footer>

    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    
    
  <script type="text/javascript" src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>

<script>  
$(function ()  
{ $("#example1").popover({trigger: 'hover'});  
  $("#example2").popover({trigger: 'hover',placement:'right'});  
  $("#example3").popover({trigger: 'hover'});  
  $("#example4").popover({trigger: 'hover',placement:'right'}); 
});   
</script> 
  </body>
</html>
